package com.redteam.data.beans;

import java.io.Serializable;

/**
 *  A java bean class for airport
 * @author Franco Morales
 */
public class Airport implements Serializable {

    private int id;
    private String name;

    /**
     * Default constructor
     */
    public Airport() {
    }

    /**
     * Full Airport constructor
     * @param id
     * @param name
     */
    public Airport(int id, String name) {
        this.id = id;
        this.name = name;
    }

    /**
     *
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Airport other = (Airport) obj;
        if (this.id != other.id) {
            return false;
        }
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 47 * hash + this.id;
        hash = 47 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "Airport{" + " id = " + id + " name = " + name + '}';
    }
}
